#include<iostream>
//一直一分为二，递归的合并两个有效数组

using namespace std;
const int N=1e5+10;
int a[N];
int n;
int tmp[N];//辅助数组，合并两个有序数组

void Sort(int left,int right)
{
	if(left>=right) return ;
	int mid=(left+right)/2;
	//递归处理左右数组
	Sort(left,mid);
	Sort(mid+1,right);

	//合并两个数组
	int cur1=left,cur2=mid+1,i=left;
	while(cur1<=mid&&cur2<=right)
	{
		if(a[cur1]<=a[cur2]) tmp[i++]=a[cur1++];
		else tmp[i++]=a[cur2++];
	}
	while(cur1<=mid) tmp[i++]=a[cur1++];
	while(cur2<=right) tmp[i++]=a[cur2++];
	for(int j=left;j<=right;j++)
	{
		a[j]=tmp[j];
	}
}
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	Sort(1,n);
	for(int i=1;i<=n;i++)
	{
		cout<<a[i]<<" ";
	}
	return 0;
}